
// a few natives missing from ScriptHook/Scripting.h
// TODO: update this, remove doubleups

#pragma once

#include "../ScriptHook/Scripting.h"
	namespace Scripting
	{
		// Add any functions you want to use but are not documented in ScriptHook here...


 //DRAW_SPRITE(GET_TEXTURE_FROM_STREAMED_TXD("network", "ICON_W_KEYBOARD_ON1"), (var7 + (var11 / ((float)2))) + L[271], L[270] + L[272], var11, var12, 0.0f, 128, 128, 128, 255);
   
		static void EndCamCommands(u32* unk1) { NativeInvoke::Invoke<ScriptVoid>("END_CAM_COMMANDS", unk1); }
		
		static void BeginCamCommands(u32* unk1) { NativeInvoke::Invoke<ScriptVoid>("BEGIN_CAM_COMMANDS", unk1); }
		static void ActivateScriptedCams(u32 unk1_1, u32 unk2_1) { NativeInvoke::Invoke<ScriptVoid>("ACTIVATE_SCRIPTED_CAMS", unk1_1, unk2_1); }
    
		static void DeleteCheckpoint(u32 checkpoint) { NativeInvoke::Invoke<ScriptVoid>("DELETE_CHECKPOINT", checkpoint); }
		static u32 CreateCheckpoint(u32 unk_type_2, f32 x, f32 y, f32 z , f32 dirx, f32 diry, f32 dirz, f32 unk_size) { return NativeInvoke::Invoke<u32>("CREATE_CHECKPOINT", unk_type_2,x,y,z,dirx,diry,dirz,unk_size); }
		static void DrawSprite(Scripting::Texture texture, f32 x, f32 y,f32 xsize, f32 ysize, f32 unk0_0,u32 r, u32 g, u32 b, u32 a) { NativeInvoke::Invoke<ScriptVoid>("DRAW_SPRITE", texture, x, y, xsize, ysize, unk0_0, r, g, b, a); }
		static void DrawTopLevelSprite(Scripting::Texture texture, f32 x, f32 y,f32 xsize, f32 ysize, f32 unk0_0,u32 r, u32 g, u32 b, u32 a) { NativeInvoke::Invoke<ScriptVoid>("DRAW_TOPLEVEL_SPRITE", texture, x, y, xsize, ysize, unk0_0, r, g, b, a); }
		static void GetMousePosition(f32* x, f32* y) { NativeInvoke::Invoke<ScriptVoid>("GET_MOUSE_POSITION", x, y); }
		static void GetScreenResolution(u32* x, u32* y) { NativeInvoke::Invoke<ScriptVoid>("GET_SCREEN_RESOLUTION", x, y); }
		static void SetCarCollision(Scripting::Vehicle veh, bool collisions) { NativeInvoke::Invoke<ScriptVoid>("SET_CAR_COLLISION", veh, collisions); }

		// --------------------------------

		static void TriggerPtfxOnPedBone(const ch* ptfxname, Scripting::Ped ped, u32 unk0_0, f32 unk1_0, f32 unk2_0, f32 unk3_0, f32 unk4_0, f32 unk5_0, Scripting::ePedBone bone, f32 unk6_1) { NativeInvoke::Invoke<ScriptAny>("TRIGGER_PTFX_ON_PED_BONE", ptfxname, ped, unk0_0, unk1_0, unk2_0, unk3_0, unk4_0, unk5_0, bone, unk6_1); }


		static void SetCharNeverTargetted(Scripting::Ped ped, bool isnevertargetted) { NativeInvoke::Invoke<ScriptVoid>("SET_CHAR_NEVER_TARGETTED", ped, isnevertargetted); }
		static void SetCharOnlyDamagedByPlayer(Scripting::Ped ped, bool isonlydamagedbyplayer) { NativeInvoke::Invoke<ScriptVoid>("SET_CHAR_ONLY_DAMAGED_BY_PLAYER", ped, isonlydamagedbyplayer); }
    

		static void GetVehicleQuaternion(Scripting::Vehicle veh, f32* w, f32* x, f32* y, f32* z) { NativeInvoke::Invoke<ScriptVoid>("GET_VEHICLE_QUATERNION", veh, w, x, y, z); }
		static void SetVehicleQuaternion(Scripting::Vehicle veh, f32 w, f32 x, f32 y, f32 z) { NativeInvoke::Invoke<ScriptVoid>("SET_VEHICLE_QUATERNION", veh, w, x, y, z); }

		static void GetObjectQuaternion(Scripting::Object obj, f32* w, f32* x, f32* y, f32* z) { NativeInvoke::Invoke<ScriptVoid>("GET_OBJECT_QUATERNION", obj, w, x, y, z); }
		static void SetObjectQuaternion(Scripting::Object obj, f32 w, f32 x, f32 y, f32 z) { NativeInvoke::Invoke<ScriptVoid>("SET_OBJECT_QUATERNION", obj, w, x, y, z); }
    
		static void AllowReactionAnims(Scripting::Ped ped, bool isallowed) { NativeInvoke::Invoke<ScriptVoid>("ALLOW_REACTION_ANIMS", ped, isallowed); }

		// --------------------------------




		// menu
		static void ActivateNetworkSettingsMenu() { NativeInvoke::Invoke<ScriptVoid>("ACTIVATE_NETWORK_SETTINGS_MENU"); }

		// player
		static void NetworkGetPlayerIDOfNextTextChat(u32 *playerID) { NativeInvoke::Invoke<ScriptVoid>("NETWORK_GET_PLAYER_ID_OF_NEXT_TEXT_CHAT", playerID); }
		static void ForceNetPlayerInvisible_UNK1(Ped unk_ped, b8 value) { NativeInvoke::Invoke<ScriptVoid>("FORCE_NET_PLAYER_INVISIBLE", unk_ped, value); }

		static const ch* NetworkGetMetPlayerName(u32 unk_plid) { return NativeInvoke::Invoke<char*>("NETWORK_GET_MET_PLAYER_NAME", unk_plid); }
		static ScriptAny IsNetworkPlayerActive(u32 unk_plid) { return NativeInvoke::Invoke<ScriptAny>("IS_NETWORK_PLAYER_ACTIVE", unk_plid); }
		static u32 FindNetworkKillerOfPlayer(u32 unk_plid) { return NativeInvoke::Invoke<ScriptAny>("FIND_NETWORK_KILLER_OF_PLAYER", unk_plid); }

		// object
		static void SetObjectRotation(Object obj, f32 x, f32 y, f32 z) { NativeInvoke::Invoke<ScriptVoid>("SET_OBJECT_ROTATION", obj, x, y, z); }
		static void SetObjectDynamic(Object object, b8 isdynamic) { NativeInvoke::Invoke<ScriptVoid>("SET_OBJECT_DYNAMIC", object, isdynamic); }
		static void SetObjectAsStealable(Scripting::Object obj, b8 stealable) { NativeInvoke::Invoke<ScriptVoid>("SET_OBJECT_AS_STEALABLE", obj, stealable); }
		static void SetObjectScale_NF(Object obj, f32 scale) { NativeInvoke::Invoke<ScriptVoid>("SET_OBJECT_SCALE", obj, scale); } //doesnt work

		// vehicle
		static void SetCarAsMissionCar(Vehicle v) { NativeInvoke::Invoke<ScriptVoid>("SET_CAR_AS_MISSION_CAR", v); }
		static void AttachCarToCarPhysically(Vehicle v1, Vehicle v2, b8 unk0, i32 unk1, f32 xoff, f32 yoff, f32 zoff, f32 xbuff, f32 ybuff, f32 zbuff, f32 unk2, f32 unk3, f32 unk4,f32 unk5,f32 unk6) { NativeInvoke::Invoke<ScriptVoid>("ATTACH_CAR_TO_CAR_PHYSICALLY", v1, v2, unk0, unk1, xoff, yoff, zoff, xbuff, ybuff, zbuff, unk2, unk3,unk4,unk5,unk6); }
		static void AttachObjectToObjectPhysically(Scripting::Object obj1, Scripting::Object obj2, b8 unk0, i32 unk1, f32 xoff, f32 yoff, f32 zoff, f32 xbuff, f32 ybuff, f32 zbuff, f32 unk2, f32 unk3, f32 unk4,f32 unk5,f32 unk6) { NativeInvoke::Invoke<ScriptVoid>("ATTACH_OBJECT_TO_OBJECT_PHYSICALLY", obj1, obj2, unk0, unk1, xoff, yoff, zoff, xbuff, ybuff, zbuff, unk2, unk3,unk4,unk5,unk6); }
		static void AttachObjectToCarPhysically(Scripting::Object obj1, Scripting::Vehicle v2, b8 unk0, i32 unk1, f32 xoff, f32 yoff, f32 zoff, f32 xbuff, f32 ybuff, f32 zbuff, f32 unk2, f32 unk3, f32 unk4,f32 unk5,f32 unk6) { NativeInvoke::Invoke<ScriptVoid>("ATTACH_OBJECT_TO_CAR_PHYSICALLY", obj1, v2, unk0, unk1, xoff, yoff, zoff, xbuff, ybuff, zbuff, unk2, unk3,unk4,unk5,unk6); }
		static void AttachObjectToObject(Object obj1, Object obj2, u32 unknown0_0, f32 pX, f32 pY, f32 pZ, f32 rX, f32 rY, f32 rZ) { NativeInvoke::Invoke<ScriptVoid>("ATTACH_OBJECT_TO_OBJECT", obj1, obj2, unknown0_0, pX, pY, pZ, rX, rY, rZ); }
		static void AttachCarToCar(Vehicle car1, Vehicle car2, u32 unknown0_0, f32 pX, f32 pY, f32 pZ, f32 rX, f32 rY, f32 rZ) { NativeInvoke::Invoke<ScriptVoid>("ATTACH_CAR_TO_CAR", car1, car2, unknown0_0, pX, pY, pZ, rX, rY, rZ); }

		// ped
		static void SetCharCollision(Ped ped, b8 value) { NativeInvoke::Invoke<ScriptVoid>("SET_CHAR_COLLISION", ped, value); }
		static void SetCharVisible(Ped ped, u8 value) { NativeInvoke::Invoke<ScriptVoid>("SET_CHAR_VISIBLE", ped, value); }
		static void SetPedAlpha(Ped ped, u32 alpha) { NativeInvoke::Invoke<ScriptVoid>("SET_PED_ALPHA", ped, alpha); }
		
		// model
		static void RequestCollisionForModel(eModel model) { NativeInvoke::Invoke<ScriptVoid>("REQUEST_COLLISION_FOR_MODEL", model); }
		static b8 HasCollisionForModelLoaded(eModel model) { return NativeInvoke::Invoke<b8>("HAS_COLLISION_FOR_MODEL_LOADED", model); }



		// network
		static int NetworkGetGameMode() { return NativeInvoke::Invoke<int>("NETWORK_GET_GAME_MODE"); }
		static b8 HasControlOfNetworkId(u32 id) { return NativeInvoke::Invoke<b8>("HAS_CONTROL_OF_NETWORK_ID", id); }
		static b8 DoesObjectExistWithNetworkId(u32 id) { return NativeInvoke::Invoke<b8>("DOES_OBJECT_EXIST_WITH_NETWORK_ID", id); }
		static b8 DoesPedExistWithNetworkId(u32 id) { return NativeInvoke::Invoke<b8>("DOES_PED_EXIST_WITH_NETWORK_ID", id); }
		static b8 DoesVehicleExistWithNetworkId(u32 id) { return NativeInvoke::Invoke<b8>("DOES_VEHICLE_EXIST_WITH_NETWORK_ID", id); }

		static void GetObjectFromNetworkId(u32 id, Scripting::Object* obj) { NativeInvoke::Invoke<ScriptVoid>("GET_OBJECT_FROM_NETWORK_ID", id, obj); }
		static void GetPedFromNetworkId(u32 id, Ped ped) { NativeInvoke::Invoke<ScriptVoid>("GET_PED_FROM_NETWORK_ID", id, ped); }
		static void GetVehicleFromNetworkId(u32 id, Vehicle car) { NativeInvoke::Invoke<ScriptVoid>("GET_VEHICLE_FROM_NETWORK_ID", id, car); }
		static void GetNetworkIdFromObject(Scripting::Object obj, u32 *id) { NativeInvoke::Invoke<ScriptVoid>("GET_NETWORK_ID_FROM_OBJECT", obj, id); }
		static void GetNetworkIdFromVehicle(Vehicle vehicle, u32 *id) { NativeInvoke::Invoke<ScriptVoid>("GET_NETWORK_ID_FROM_VEHICLE", vehicle, id); }
		static void GetNetworkIdFromPed(Ped ped, u32 *id) { NativeInvoke::Invoke<ScriptVoid>("GET_NETWORK_ID_FROM_PED", ped, id); }
		static b8 RequestControlOfNetworkId(u32 id) { return NativeInvoke::Invoke<b8>("REQUEST_CONTROL_OF_NETWORK_ID", id); }
		static void SetNetworkIdCanMigrate(u32 id, b8 canmigrate) { NativeInvoke::Invoke<ScriptVoid>("SET_NETWORK_ID_CAN_MIGRATE", id, canmigrate); }
		static void SetNetworkIdExistsOnAllMachines(u32 id, b8 exists) { NativeInvoke::Invoke<ScriptVoid>("SET_NETWORK_ID_EXISTS_ON_ALL_MACHINES", id, exists); }
		static void SetNetworkIdStopCloning(u32 id, b8 unk_stop) { NativeInvoke::Invoke<ScriptVoid>("SET_NETWORK_ID_STOP_CLONING", id, unk_stop); }
		static void NetworkKickPlayer(u32 networkID) { NativeInvoke::Invoke<ScriptVoid>("NETWORK_KICK_PLAYER", networkID); }
		static void ForceNetPlayerInvisible_UNK2(u32 unk_nid, b8 value) { NativeInvoke::Invoke<ScriptVoid>("FORCE_NET_PLAYER_INVISIBLE", unk_nid, value); }
	};
